INCLUDE(${ARCH}/CMakeLists.txt)

SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARCH_COMPILE_FLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARCH_COMPILE_FLAGS}")

ADD_EXECUTABLE(brain Console.cpp
			Cpu.cpp
			EventController.cpp
			IModule.cpp
			ivec.cpp
			Jvm.cpp
			kmm.cpp
			Llvm.cpp
			main.cpp
			MemFactory.cpp
			MemReader.cpp
			MemTypes.cpp
			Object.cpp
			PageFactory.cpp
			Platform.cpp
			Scheduler.cpp
			string.cpp
			SysCalls.cpp
			Task.cpp
			TaskFactory.cpp
			VmMap.cpp
			${ARCH_SOURCES}
            ${BRAIN_HEADERS}
)

ADD_DEPENDENCIES(brain agents)
TARGET_LINK_LIBRARIES(brain gcc)
TARGET_LINK_LIBRARIES(brain -Wl,-whole-archive ${LIBRARY_OUTPUT_PATH}/libagents.a -Wl,-no-whole-archive)
SET_TARGET_PROPERTIES(brain PROPERTIES LINK_FLAGS ${ARCH_LINK_FLAGS})

